package cn.com.surker.enums.mes;

import cn.com.surker.enums.ICodeDescEnum;

/**
 * @Author lucky
 * @create 2023年10月12 10:49
 * @desc 构件类型
 */
public enum MemberTypeEnum implements ICodeDescEnum {

    BROAD(0,"叠合板"),
    COLUMN(1,"柱子"),
    STAIR(2,"楼梯"),
    ROUND(3,"圆墩"),
    WINDOW(4,"飘窗"),
    ;

    private final String description;

    private final Integer code;

    MemberTypeEnum(Integer code, String description) {
        this.description = description;
        this.code = code;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public Integer getCode() {return code;}

    public static String getDesc(Integer code) {
        for (MemberTypeEnum typeEnum : values()) {
            if (typeEnum.getCode().equals(code)) {
                return typeEnum.getDescription();
            }
        }
        return null;
    }

    public static Integer getCode(String desc) {
        for (MemberTypeEnum typeEnum : values()) {
            if (typeEnum.getDescription().equals(desc)) {
                return typeEnum.getCode();
            }
        }
        return null;
    }
}